package androidawn.framework.control.operations;

import androidawn.framework.control.IUserOperation;
import androidawn.framework.control.UserOperationFields;
import androidawn.framework.control.UserOperations;

public class FocusChangedOperation implements IUserOperation {

	private int viewId;
	
	private boolean hasFocus;
	
	public FocusChangedOperation(int viewId, boolean hasFocus)
	{
		this.viewId = viewId;
		this.hasFocus = hasFocus;
	}
	
	@Override
	public int getView() {
		return viewId;
	}

	@Override
	public int getOperationId() 
	{
		return UserOperations.FOCUS_CHANGED;
	}

	@Override
	public Object getInfo(int field) 
	{
		switch(field)
		{
			case UserOperationFields.VIEW_ID:
				return viewId;
			case UserOperationFields.HAS_FOCUS:
				return hasFocus;
		}
		return null;
	}

}
